/**   
* @Title: OrderSrvImpl.java 
* @Package com.dkt.wap.service 
* @Description: TODO(用一句话描述该文件做什么) 
* @author A18ccms A18ccms_gmail_com   
* @date 2020年7月2日 下午7:35:46 
* @version V1.0   
*/
package com.dkt.wap.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dkt.base.StrUtil;
import com.dkt.base.domain.Order;
import com.dkt.wap.domain.OrderMapper;
import com.dkt.wap.web.dto.OrderDto;

/**
 *  
 * @ClassName:  OrderSrvImpl 
 * @PackageName com.dkt.wap.service 
 * @Description: TODO(这里用一句话描述这个类的作用) 
 * @author xuy
 * @date: 2020年7月2日 下午7:35:46 
 * @version V1.0 
 */
@Service
public class OrderSrvImpl implements OrderSrv {

	
	@Autowired
	private OrderMapper mapper; 

	
	/* (non-Javadoc)  
	 * <p>Title: orderList</p>  
	 * <p>Description: </p>  
	 * @param orderDto
	 * @return  
	 * @see com.dkt.wap.service.OrderSrv#orderList(com.dkt.wap.web.dto.OrderDto)  
	 */
	@Override
	public List<Order> orderList(OrderDto orderDto) {
		Integer page = 1;
		try {
			page = Integer.parseInt(orderDto.getPage());
		} catch (NumberFormatException e) {

		}
		return mapper.selOrder((page - 1) * 10);
	}

	/* (non-Javadoc)  
	 * <p>Title: addItem</p>  
	 * <p>Description: </p>  
	 * @param itemDto  
	 * @see com.dkt.wap.service.OrderSrv#addItem(com.dkt.wap.web.dto.ItemDto)  
	 */
	@Override
	public void addItem(OrderDto orderDto) {
		Order order = new Order();
		order.setId(StrUtil.genUUID());
		order.setBuyer(orderDto.getBuyer());
		order.setItemId(orderDto.getItemId());
		mapper.insOrder(order);
	}

}
